package com.example.mvicore.ui

import android.os.Bundle
import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.ViewModel
import androidx.lifecycle.ViewModelProvider

abstract class BaseMVIActivity : BaseActivity(){

    override fun onCreate(savedInstanceState: Bundle?) {
        generateModel()
        super.onCreate(savedInstanceState)
    }

    /**
     * 生成model实例
     */
    abstract fun generateModel()

//    inner class CustomViewModelFactory:ViewModelProvider.Factory{
//        override fun <T : ViewModel> create(modelClass: Class<T>): T {
//            return modelClass.getConstructor(LifecycleOwner::class.java).newInstance(this@BaseMVIActivity)
//        }
//
//    }

}